$.fn.menuLeft = function () {
    var $windowWidth;
    var $menuWidth;
    var $windowHeight;
    var $headerHeight;
    var $personHeight;
    var $menubottomHeight;
    var $mainHeight;
    $windowWidth = $(window).width();
    $menuWidth = $(".mm-menu.mm-widescreen").width();
    $windowHeight = $(window).height();
    $headerHeight = $(".header").height();
    $mainHeight = $windowHeight - $headerHeight;
    $(".mm-menu").css("margin-top", $headerHeight);
    $(".mm-page").css("margin-top", $headerHeight);
    $(".person .dropdown-menu").removeClass("mm-listview");
    $("#mainScroll").height($windowHeight);
    $("#kcPlayIframe").height($mainHeight - $headerHeight);//课程中心iframe高度
    $(".play").height($windowHeight);//播放页高度
    $("#muLuShow,#noteShow,#answerShow").height($windowHeight-$(".play .nav").height());//播放页目录高度
    $(".play .panel").height($windowHeight-90);//播放页高度
    $(".play .panel-default .panel-body").height($windowHeight-235);
    $("#paperScroll").height($mainHeight-130);
    var navli=$('#menuScroll').children(".mm-listview").children("li");
    navli.click(function() {
        if($(this).hasClass("mm-opened")){
            return;
        }else{
            navli.removeClass("mm-opened");
        }
    });//左侧菜单仅展开一项
    var $personHeight=$(".person").height()+40;
    $(".mm-hasnavbar-top-3 .mm-panel").css("top",$personHeight);//左侧个人信息头部高度
};
$.fn.lineChart = function () {
  var d0 = [
    [0,0],[1,0],[2,1],[3,2],[4,15],[5,5],[6,12],[7,10],[8,55],[9,13],[10,25],[11,10],[12,12],[13,6],[14,2],[15,0],[16,0]
  ];
  var d00 = [
    [0,0],[1,0],[2,1],[3,0],[4,1],[5,0],[6,2],[7,0],[8,3],[9,1],[10,0],[11,1],[12,0],[13,2],[14,1],[15,0],[16,0]
  ];
  $.plot("#placeholder", [
            { label: "sin(x)", data: d0 },
            { label: "tan(x)", data: d00 }
        ], 
      {
        series: {
            lines: {
                show: false
            },
            splines: {
              show: true,
              tension: 0.4,
              lineWidth: 1,
              fill: 0.4
            },
            points: {
                radius: 0,
                show: true
            },
            points: {
                radius: 0,
                show: true
            },
            shadowSize: 2
        },
        grid: {
            hoverable: true,
            clickable: true,
            tickColor: "#d9dee9",
            borderWidth: 1,
            color: '#d9dee9'
        },
        colors: ["#19b39b", "#644688"],
        xaxis:{
            ticks: [[1, "1月"], [3, "3月"], [5, "5月"], [7, "7月"], [9, "9月"], [11, "11月"]], 
            min: 1, max: 12
        },
        yaxis: {
          ticks: 4
        },
        tooltip: true,
        tooltipOpts: {
          content: "测试: %x.1 is %y.4",
          defaultTheme: false,
          shifts: {
            x: 0,
            y: 20
          }
        }
      }
      );
};
$.fn.tableTree =function () {
    var $tableRightH = $(".table-tree .table-right").height();
    $(".table-tree .table-left").height($tableRightH);
    var $tableLeftH = $(".table-tree .table-left").height();
    var $tableLeftheaderH = $(".table-tree .table-left .panel-heading").height();
    $(".table-tree .table-left .panel-body").height($tableLeftH - $tableLeftheaderH - 40);
    $('.table-left .collapse').on('shown.bs.collapse', function () {
        $(".table-tree .table-left .panel-body").height($tableLeftH - $tableLeftheaderH - 80);
    });
    $('.table-left .collapse').on('hidden.bs.collapse', function () {
        $(".table-tree .table-left .panel-body").height($tableLeftH - $tableLeftheaderH - 40);
    });//左右带树搜索表格
}
$.fn.mainColTwo =function () {
    var $mainRightH = $(".main-right").height();
    var $mainLeftH = $(".main-left").height();
    var $windowHeight = $(window).height();
    var $headerHeight = $(".header").height();
    var $mainHeight = $windowHeight - $headerHeight;
    if( $mainLeftH !== null){
        if( $mainLeftH < $mainHeight ){
            $(".main-left").css("min-height",$mainHeight);
        }
        if( $mainLeftH > $mainRightH ){
            $(".main-right").height($mainLeftH);
        }else{
            $("#mainScroll").addClass("bg-blue");
        }
    }//main左右两模块颜色不同高度相等
}
$(function () {
    $(window).menuLeft();//左侧导航js
    $(".dashboard .well").hover(function(){
        $(this).addClass("pulse");
    },function(){
        $(this).removeClass("pulse");
    })
});
window.onresize = function(){
    $(window).menuLeft();//变更浏览器刷新左侧导航js
};